package com.frank.easyexcel.serive;

import com.frank.easyexcel.entity.TArea;
import com.frank.easyexcel.respository.TAreaRepository;

/**
 * @author 小石潭记
 * @date 2021/4/4 13:56
 * @Description: ${todo}
 */
public class AreaTask implements Runnable {

    private TAreaRepository repository;

    int i = 0;

    public AreaTask(int i, TAreaRepository repository) {
        this.i = i;
        this.repository = repository;
    }

    @Override
    public void run() {
        TArea tArea = new TArea();
        tArea.setAreaName("北京" + i);
        tArea.setParentName("中国" + i);
        tArea.setParentId(i);
        tArea.setLevel("等级" + i);
        repository.save(tArea);
    }
}
